const express = require('express');
const router = express.Router();
router.get('/forCurrentUser', (req, res) => {
    const content = [];
    for(let i = 0; i < 20; i++)
        content.push({
            id: `2019${i}`,
            code: 'string',
            brandCode: 'string',
            dealerCode: 'string',
            subDealerCode: 'string',
            country: 'string',
            city: 'string',
            customerName: 'string',
            productCategoryCode: 'string',
            saleDate: '2020-06-22T05:39:30.686Z',
            createTime: '2020-06-22T05:39:30.686Z',
            status: 0,
            rowVersion: 'string',
            options: ['update', 'abandon', 'add']
        });
    res.json({
        message: '',
        payload: {
            content,
            totalElements: 20,
        }
    });
});

router.get('/:id', (req, res) => {
    res.json(
        {
            message: 'string',
            payload: {
                id: '20191',
                code: 'string',
                brandCode: 'string',
                dealerCode: 'string',
                subDealerCode: 'string',
                country: 'string',
                city: 'string',
                customerName: 'string',
                productCategoryCode: 'string',
                saleDate: '2020-06-22T05:40:27.150Z',
                createTime: '2020-06-22T05:40:27.150Z',
                gender: 0,
                contactNumber: 'string',
                age: 0,
                status: 0,
                rowVersion: 'string',
                options: ['update', 'abandon', 'opeation', 'submit'],
                details: [
                    {
                        id: '${i}',
                        num: 'string',
                        others: 'string',
                        questionContent: 0,
                        score: 0,
                        extraDetails: [
                            {
                                id: '${i}11',
                                serialNumber: 0,
                                optionName: 'string',
                                remark: 'string'
                            }
                        ],
                    }
                ],
            }
        }
    );
});

router.put('/:id', (req, res) => {
    res.json(
        {
            message: '修改成功'
        }
    );
});

router.post('/', (req, res) => {
    res.json(
        {
            message: '新增成功'
        }
    );
});

router.put('/:id/abandon', (req, res) => {
    res.json({
        message: '作废成功'
    });
});
module.exports = router;
